import request from "@/utils/request";

export function login(data) {
  return request({
    url: "api/v1/PermissionUser/Login",
    method: "post",
    data,
  });
}

export function updatePassword(data) {
  return request({
    url: '/api/v1/PermissionUser/UpdatePassword',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: "api/v1/PermissionUser/GetInfo",
    method: "get",
    params: { token },
  });
}

export function logout() {
  return request({
    url: "api/v1/vue-admin-template/user/logout",
    method: "post",
  });
}

// 获取系统基本配置
export function getBaseConfig(token) {
  return request({
    url: "api/v1/SystemBasis/GetBaseConfig",
    method: "get",
    params: { token },
  });
}

// 原modulepermission下接口
export const getUserListNoPage = (params) =>
  request("api/v1/PermissionUser/GetUserListNoPage", { params: params });

// 获取用户组列表
export const GetUserGroupList = (params) =>
  request("api/v1/PermissionUserGroup/GetList", { params: params });

export function findUserMenu() {
  return request({
    url: "api/v1/PermissionUser/FindUserMenu",
    method: "get",
    params: { appKey: window.EnvConfig.VUE_APP_KEY },
  });
}
